package xyz.jcat.docker.example.service.impl;

import org.springframework.stereotype.Service;
import xyz.jcat.docker.example.domain.dao.ITestDao;
import xyz.jcat.docker.example.domain.po.TestPo;
import xyz.jcat.docker.example.service.ITestService;
import xyz.jcat.mybatis.ServiceImpl;

import java.util.Date;
import java.util.List;

/**
 *
 * @author yueyue
 * auto on 2021-12-22 14:37:44
 */
@Service
public class TestService extends ServiceImpl<ITestDao, TestPo> implements ITestService {

    @Override
    public void addTest(String name) {
        TestPo test = new TestPo();
        test.setName(name);
        test.setCreateTime(new Date());
        test.setUpdateTime(test.getCreateTime());
        test.setCreator(1L);
        test.setUpdater(test.getCreator());
        dao.insert(test);
    }

    @Override
    public List<TestPo> getTests() {
        return dao.selectList(null);
    }
}
